QString("</p></font>");
setWindowTitle(tr("About"));
- mainLayout = new QVBoxLayout;
+ mainLayout = new QVBoxLayout(this);
#ifndef Q_WS_MAEMO_5
- scrollLayout = new QVBoxLayout;
- scroll = new QScrollArea;
+ scrollLayout = new QVBoxLayout(this);
+ scroll = new QScrollArea(this);
w = new QWidget(this);
#endif
- imageLabel = new QLabel;
- mainLabel = new QLabel;
- licenseLabel = new QLabel;
+ imageLabel = new QLabel(this);
+ mainLabel = new QLabel(this);
+ licenseLabel = new QLabel(this);
QImage img(":/icons/logo/mdictionary.png");
{
setWindowTitle(tr("Bookmarks"));
- verticalLayout = new QVBoxLayout;
+ verticalLayout = new QVBoxLayout(this);
setLayout(verticalLayout);
- showAllBookmarksPushButton = new QPushButton(tr("Show all bookmarks"));
+ showAllBookmarksPushButton = new QPushButton(tr("Show all bookmarks"),this);
removeAllBookmarksPushButton =
- new QPushButton(tr("Remove all bookmarks"));
+ new QPushButton(tr("Remove all bookmarks"),this);
verticalLayout->addWidget(showAllBookmarksPushButton);
verticalLayout->addWidget(removeAllBookmarksPushButton);
setWindowTitle(tr("Dictionaries"));
this->guiInterface = parent;
- verticalLayout = new QVBoxLayout;
+ verticalLayout = new QVBoxLayout(this);
setLayout(verticalLayout);
- dictListWidget = new QListWidget;
+ dictListWidget = new QListWidget(this);
verticalLayout->addWidget(dictListWidget);
dictListWidget->setSelectionMode(QAbstractItemView::SingleSelection);
dictListWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- addNewDictButton = new QPushButton(tr("Add"));
- removeDictButton = new QPushButton(tr("Remove"));
- settingsButton = new QPushButton(tr("Settings"));
+ addNewDictButton = new QPushButton(tr("Add"),this);
+ removeDictButton = new QPushButton(tr("Remove"),this);
+ settingsButton = new QPushButton(tr("Settings"),this);
removeDictButton->setEnabled(false);
settingsButton->setEnabled(false);
- buttonGroup = new QHBoxLayout;
+ buttonGroup = new QHBoxLayout(this);
buttonGroup->addWidget(addNewDictButton);
buttonGroup->addWidget(removeDictButton);
while(i.hasNext()) {
i.next();
- QListWidgetItem* item = new QListWidgetItem;
+ QListWidgetItem* item = new QListWidgetItem();
QString name = i.key()->langFrom() + " - " + i.key()->langTo() + " (" +
i.key()->type() + " " + i.key()->name() + ")";
item->setText(name);
this->plugins = plugins;
- verticalLayout = new QVBoxLayout;
+ verticalLayout = new QVBoxLayout(this);
setLayout(verticalLayout);
- pluginsListWidget = new QListWidget;
+ pluginsListWidget = new QListWidget(this);
verticalLayout->addWidget(pluginsListWidget);
HistoryListDialog::HistoryListDialog(QStringList words, QWidget *parent):
QDialog(parent)
{
- verticalLayout = new QVBoxLayout;
+ verticalLayout = new QVBoxLayout(this);
setLayout(verticalLayout);
oryginalList = words;
- historyListWidget = new QListWidget;
+ historyListWidget = new QListWidget(this);
verticalLayout->addWidget(historyListWidget);
for(int i=0; i<words.count(); i++) {
translationWidget = new TranslationWidget(this);
- mainLayout = new QVBoxLayout;
- QWidget* w = new QWidget;
+ mainLayout = new QVBoxLayout(this);
+ QWidget* w = new QWidget(this);
w->setLayout(mainLayout);
setCentralWidget(w);
- menuBar = new QMenuBar;
+ menuBar = new QMenuBar(this);
setMenuBar(menuBar);
- searchBarWidget = new SearchBarWidget;
+ searchBarWidget = new SearchBarWidget(this);
- wordListWidget = new WordListWidget;
+ wordListWidget = new WordListWidget(this);
- welcomeScreenWidget = new WelcomeScreenWidget;
+ welcomeScreenWidget = new WelcomeScreenWidget(this);
#ifdef Q_WS_MAEMO_5
QWidgetAction(parent) {
//creating custom tab widget, and sets style sheet to have centered tabs
- tabWidget = new MenuTabWidget();
+ tabWidget = new MenuTabWidget(this);
tabWidget->setStyleSheet("QTabWidget::tab-bar {alignment: center;}");
}
#endif
- horizontalLayout = new QHBoxLayout();
- verticalLayout = new QVBoxLayout();
+ horizontalLayout = new QHBoxLayout(this);
+ verticalLayout = new QVBoxLayout(this);
- searchPushButton = new QPushButton(tr("Search"));
+ searchPushButton = new QPushButton(tr("Search"),this);
searchPushButton->setMinimumWidth(125);
- searchWordLineEdit = new QLineEdit();
+ searchWordLineEdit = new QLineEdit(this);
searchWordLineEdit->setMinimumWidth(250);
#ifndef Q_WS_MAEMO_5
//create layout for lineEdit to have clear button on it
- QHBoxLayout* lineEditLayout = new QHBoxLayout;
+ QHBoxLayout* lineEditLayout = new QHBoxLayout(this);
searchWordLineEdit->setLayout(lineEditLayout);
- clearSearchWordToolButton = new QToolButton();
+ clearSearchWordToolButton = new QToolButton(this);
#ifdef Q_WS_MAEMO_5
clearSearchWordToolButton->setIcon(QIcon::fromTheme("general_stop"));
//tool buttons will have size 2 times smaller
#endif
- historyNextToolButton = new QToolButton();
+ historyNextToolButton = new QToolButton(this);
#ifdef Q_WS_MAEMO_5
historyNextToolButton->setIcon(
generateIcon(QIcon::fromTheme("general_forward")));
- historyPrevToolButton = new QToolButton();
+ historyPrevToolButton = new QToolButton(this);
#ifdef Q_WS_MAEMO_5
historyPrevToolButton->setIcon(
generateIcon(QIcon::fromTheme("general_back")));
- historyShowToolButton = new QToolButton();
+ historyShowToolButton = new QToolButton(this);
#ifdef Q_WS_MAEMO_5
historyShowToolButton->setIcon(
generateIcon(QIcon::fromTheme("general_back"), 90));
#endif*/
- searchingProgressBar = new QProgressBar();
+ searchingProgressBar = new QProgressBar(this);
//progress bar have minimum and maximum values set to 0, which will effect
//with "I'm alive" bar
searchingProgressBar->setMinimum(0);
setWindowTitle(tr("Settings"));
- verticalLayout = new QVBoxLayout;
+ verticalLayout = new QVBoxLayout(this);
setLayout(verticalLayout);
- historySizeSpinBox = new QSpinBox;
- searchResultSizeSpinBox = new QSpinBox;
+ historySizeSpinBox = new QSpinBox(this);
+ searchResultSizeSpinBox = new QSpinBox(this);
- spinBoxesFormLayout = new QFormLayout;
+ spinBoxesFormLayout = new QFormLayout(this);
spinBoxesFormLayout->addRow(tr("Search result size"),
searchResultSizeSpinBox);
verticalLayout->addLayout(spinBoxesFormLayout);
- checkBoxesLabel = new QLabel(tr("Search in:"));
+ checkBoxesLabel = new QLabel(tr("Search in:"),this);
- searchInBookmarksCheckBox = new QCheckBox(tr("Bookmarks"));
- searchInDictionariesCheckBox = new QCheckBox(tr("Dictionaries"));
+ searchInBookmarksCheckBox = new QCheckBox(tr("Bookmarks"),this);
+ searchInDictionariesCheckBox = new QCheckBox(tr("Dictionaries"),this);
verticalLayout->addSpacing(20);
verticalLayout->addWidget(checkBoxesLabel);
trans=tr("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") + tr("\n <ar>") + trans + tr("\n </ar>");
trans=XslConversion(trans);
-// textEdit->setDocument(document);
textEdit->insertHtml(trans);
-// textEdit->append("<img src=\"mydata://image.png\" />");
- // textEdit->textCursor().insertImage("starimage");
-
// textEdit->setPlainText(trans);
textEdit->repaint(this->rect());
-
update(this->rect());
emit updateSize();
void TranslationWidget::initializeUI() {
- textEdit = new TranslationTextEdit;
+ textEdit = new TranslationTextEdit(this);
textEdit->setReadOnly(true);
resizer = new TranslationWidgetAutoResizer(textEdit);
connect(this, SIGNAL(updateSize()),
resizer, SLOT(textEditChanged()));
- QWidget*w = new QWidget;
+ QWidget*w = new QWidget(this);
verticalLayout = new QVBoxLayout(w);
verticalLayout->addWidget(textEdit);
#include <QString>
#include <QHash>
#include "CommonDictInterface.h"
+#include <QDebug>
class CommonDictInterface;
Settings(const Settings* set) {
_settings = QHash<QString, QString>(set->_settings);
}
+ ~Settings(){}
/*! \returns value fo given key
\param key
setLayout(verticalLayout);
setWindowTitle(tr("Caching dictionary, please wait"));
- cachingProgressBar = new QProgressBar;
+ cachingProgressBar = new QProgressBar(this);
cachingProgressBar->setMinimum(0);
cachingProgressBar->setMaximum(100);
cachingProgressBar->setTextVisible(true);
- cancelButton = new QPushButton(tr("Cancel"));
+ cancelButton = new QPushButton(tr("Cancel"),this);
- cachingLabel = new QLabel();
+ cachingLabel = new QLabel(this);
cachingLabel->hide();
Q_OBJECT
public:
explicit XdxfDictDialog(XdxfPlugin* plugin, QObject *parent = 0);
-
/*!
Shows add new xdxf dictionary dialog and returns settings of new dict
\param parent parent widget on which will be displayed dialog
XdxfLoadDialog::XdxfLoadDialog(QWidget *parent) :
QDialog(parent) {
- verticalLayout = new QVBoxLayout;
+ verticalLayout = new QVBoxLayout(this);
setLayout(verticalLayout);
setWindowTitle(tr("Add new XDXF dictionary"));
- browseLayout = new QHBoxLayout;
+ browseLayout = new QHBoxLayout(this);
verticalLayout->addLayout(browseLayout);
- browseButton = new QPushButton(tr("Browse"));
- browseLabel = new QLabel(tr("Dictionary file: not selected"));
+ browseButton = new QPushButton(tr("Browse"),this);
+ browseLabel = new QLabel(tr("Dictionary file: not selected"),this);
browseLayout->addWidget(browseLabel);
browseLayout->addWidget(browseButton,0, Qt::AlignRight);
- cacheLayout = new QHBoxLayout;
+ cacheLayout = new QHBoxLayout(this);
verticalLayout->addLayout(cacheLayout);
- cacheCheckBox = new QCheckBox(tr("Optimize for quicker searches (may take some time)"));
+ cacheCheckBox = new QCheckBox(tr("Optimize for quicker searches (may take some time)"),this);
cacheCheckBox->setChecked(true);
cacheLayout->addWidget(cacheCheckBox);
- addButton = new QPushButton(tr("Add"));
+ addButton = new QPushButton(tr("Add"),this);
verticalLayout->addWidget(addButton);
QDialog(parent)
{
this->plugin = plugin;
- verticalLayout = new QVBoxLayout;
+ verticalLayout = new QVBoxLayout(this);
setLayout(verticalLayout);
setWindowTitle(tr("XDXF Settings"));
- infoLabel = new QLabel;
+ infoLabel = new QLabel(this);
infoLabel->setText(tr("Plugin type: ") + plugin->type() +"\n" +
tr("From: ") + plugin->langFrom() + "\n" +
verticalLayout->addWidget(infoLabel);
- browseLayout = new QHBoxLayout;
+ browseLayout = new QHBoxLayout(this);
verticalLayout->addLayout(browseLayout);
- browseButton = new QPushButton(tr("Browse"));
+ browseButton = new QPushButton(tr("Browse"),this);
browseLabel = new QLabel(tr("Dictionary file: ") +
- plugin->settings()->value("path"));
+ plugin->settings()->value("path"),this);
browseLayout->addWidget(browseLabel);
browseLayout->addWidget(browseButton,0, Qt::AlignRight);
- cacheLayout = new QHBoxLayout;
+ cacheLayout = new QHBoxLayout(this);
verticalLayout->addLayout(cacheLayout);
- cacheCheckBox = new QCheckBox(tr("Cached"));
+ cacheCheckBox = new QCheckBox(tr("Cached"),this);
if(plugin->settings()->value("cached") == "true") {
cacheCheckBox->setChecked(true);
_generateCache = true;
cacheLayout->addWidget(cacheCheckBox);
- saveButton = new QPushButton(tr("Save settings"));
+ saveButton = new QPushButton(tr("Save settings"),this);
verticalLayout->addWidget(saveButton);
settings->setValue("generateCache", "false");
}
plugin->setSettings(settings);
- return NULL;
+ delete settings;
+ return 0;
}
- return NULL;
+ return 0;
}