Пример #1
0
/**
 * Second Panel - Shows the extra metadata in a tree, non editable.
 **/
ExtraMetaPanel::ExtraMetaPanel( QWidget *parent ) : QWidget( parent )
{
     QGridLayout *layout = new QGridLayout(this);

     QLabel *topLabel = new QLabel( qtr( "Extra metadata and other information"
                 " are shown in this panel.\n" ) );
     topLabel->setWordWrap( true );
     layout->addWidget( topLabel, 0, 0 );

     extraMetaTree = new QTreeWidget( this );
     extraMetaTree->setAlternatingRowColors( true );
     extraMetaTree->setColumnCount( 2 );
     extraMetaTree->resizeColumnToContents( 0 );
     extraMetaTree->setHeaderHidden( true );
     layout->addWidget( extraMetaTree, 1, 0 );
}
void ChatGroupsConfigurationWidget::createGui()
{
    auto layout = new QVBoxLayout{this};

    QLabel *label =
        new QLabel{tr("Add <b>%1</b> to the groups below by checking the box next to the appropriate groups.")
                       .arg(m_chat.display()),
                   this};
    label->setWordWrap(true);

    m_groupList = m_injectedFactory->makeInjected<GroupList>(this);
    m_groupList->setCheckedGroups(m_chat.groups());

    layout->addWidget(label);
    layout->addWidget(m_groupList);
}
Пример #3
0
EditNullView::EditNullView() 
  : QWidget()
{
  QVBoxLayout * mainVLayout = new QVBoxLayout();
  mainVLayout->setContentsMargins(5,5,5,5);
  mainVLayout->setSpacing(5);
  setLayout(mainVLayout);
  
  QLabel * label = new QLabel();
  label->setText("Select a Measure to Edit");
  label->setWordWrap(true);
  label->setAlignment(Qt::AlignCenter);
  mainVLayout->addWidget(label);

  label->setStyleSheet("QLabel { font-size: 24px; font: bold; color: #6D6D6D }");
}
Пример #4
0
void FileInfoGroupBox::setFileInfo(QString fileInfoTitle, QList<fileInfoItem> fileInfoList)
{
	// Set the title
	setTitle(fileInfoTitle);

	if (fileInfoList.count() == p_nrLabelPairs) {
		// The correct number of label pairs is already in the groupBox.
		// No need to delete all items and reattach them. Just update the text.
		for (int i = 0; i < p_nrLabelPairs; i++)
		{
			assert(p_nrLabelPairs * 2 == p_labelList.count());

			p_labelList[i * 2    ]->setText(fileInfoList[i].first);
			p_labelList[i * 2 + 1]->setText(fileInfoList[i].second);
		}
	}
	else {
		// Update the grid layout. Delete all the labels and add as many new ones as necessary.

		// Clear the grid layout
		foreach(QLabel *l, p_labelList) {
			p_gridLayout->removeWidget(l);
			delete l;
		}
		p_labelList.clear();

		// For each item in the list add a two labels to the grid layout
		int i = 0;
		foreach(fileInfoItem info, fileInfoList) {
			// Create labels
			QLabel *newTextLabel = new QLabel(info.first);
			QLabel *newValueLabel = new QLabel(info.second);
			newValueLabel->setWordWrap(true);

			// Add to grid
			p_gridLayout->addWidget(newTextLabel, i, 0);
			p_gridLayout->addWidget(newValueLabel, i, 1);

			// Set row stretch to 0
			p_gridLayout->setRowStretch(i, 0);

			i++;

			// Add to list of labels
			p_labelList.append(newTextLabel);
			p_labelList.append(newValueLabel);
		}
Пример #5
0
CAbout::CAbout( QWidget *pwidgetParent, const char *pszName )
	: QWidget( pwidgetParent, pszName )
{
    QVBoxLayout *   playoutTop;
    QHBoxLayout *   playoutHelp;
    CAboutDiagram * pdiagram;
    QFrame *        pframeHelp;
	QLabel *        plabelIcon;
	QLabel *        plabelText;
	QPushButton *   ppushbuttonCredits;

    playoutTop          = new QVBoxLayout( this, 5 );

    // DIAGRAM
    pdiagram            = new CAboutDiagram( this );

    playoutTop->addWidget( pdiagram, 10 );

    // HELP - FRAME
    pframeHelp          = new QFrame( this );
    pframeHelp->setFrameStyle( QFrame::Box | QFrame::Raised );

    playoutTop->addWidget( pframeHelp );

    //
    playoutHelp         = new QHBoxLayout( pframeHelp, 5 );

	plabelIcon          = new QLabel( pframeHelp );
    plabelIcon->setPixmap( xpmAbout );

	plabelText          = new QLabel( pframeHelp );
	plabelText->setText( "Open DataBase Connectivity (ODBC) was developed to be an Open and portable standard for accessing data. unixODBC implements this standard for Linux/UNIX.\nhttp://www.unixodbc.org" );
#ifdef QT_V4LAYOUT
	plabelText->setAlignment(  Qt::AlignLeft | Qt::WordBreak  );
  	plabelText->setWordWrap( true );
#else
	plabelText->setAlignment(  AlignLeft | WordBreak  );
#endif

	ppushbuttonCredits  = new QPushButton( pframeHelp );
	connect( ppushbuttonCredits, SIGNAL(clicked()), SLOT(pbCredits_Clicked()) );
	ppushbuttonCredits->setText( "&Credits" );

    playoutHelp->addWidget( plabelIcon );
    playoutHelp->addWidget( plabelText, 10 );
    playoutHelp->addWidget( ppushbuttonCredits );
}
Пример #6
0
FirstRunWelcomePage::FirstRunWelcomePage(AntiMicroSettings *settings, QWidget *parent) :
    QWizardPage(parent)
{
    this->settings = settings;

    setTitle(tr("Welcome"));
    setLayout(new QVBoxLayout);

    QLabel *tempLabel = new QLabel(
                tr("Thank you for checking out antimicro. This "
                   "wizard can be used to customize some of the "
                   "program's behavior. More settings can be found "
                   "from the main interface under "
                   "Options > Settings."));
    tempLabel->setWordWrap(true);
    layout()->addWidget(tempLabel);
}
Пример #7
0
void ReplaceBandInputWizard::addDestBandPage()
{
   QWizardPage* pPage = new QWizardPage(this);
   pPage->setTitle("Select destination band");
   QLabel* pPageLabel = new QLabel("Select the destination band.", pPage);
   pPageLabel->setWordWrap(true);
   mpDestBand = new QComboBox(pPage);
   mpDestBand->setEditable(false);
   mpDestBand->addItems(getBandNames(static_cast<const RasterDataDescriptor*>(mpDest->getDataDescriptor())));

   QVBoxLayout* pLayout = new QVBoxLayout();
   pLayout->addWidget(pPageLabel);
   pLayout->addWidget(mpDestBand);
   pPage->setLayout(pLayout);

   addPage(pPage);
}
Пример #8
0
BTSettingsMainWindow::BTSettingsMainWindow(QWidget *parent, Qt::WFlags fl)
    : QMainWindow(parent, fl), m_localDevice(new QBluetoothLocalDevice(this)),
      m_controller(0)
{
    if (!m_localDevice->isValid()) {
        QLabel *label = new QLabel(tr("(Bluetooth not available.)"));
        label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
        label->setWordWrap(true);
        label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
        setCentralWidget(label);
        return;
    }

    QScrollArea* scroll = new QScrollArea();
    scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    scroll->setWidgetResizable(true);
    scroll->setFrameStyle(QFrame::NoFrame);

    m_menu = QSoftMenuBar::menuFor(this);
    m_tabs = new QTabWidget();

    m_controller =
            new QCommDeviceController(m_localDevice->deviceName().toLatin1(), this);

    SettingsDisplay *settings = new SettingsDisplay(m_localDevice, m_controller);
    scroll->setWidget(settings);
    scroll->setFocusProxy(settings);
    m_tabs->addTab(scroll, tr("Settings"));

    // Delay initialization of tabs other than the first
    m_tabs->addTab(new QWidget, tr("Paired Devices"));
    m_tabs->setTabEnabled(1, false);

    m_tabs->setCurrentIndex(0);

    // change the context menu when the tab changes
    connect(m_tabs, SIGNAL(currentChanged(int)), SLOT(tabChanged(int)));

    // set the current context menu
    tabChanged(m_tabs->currentIndex());

    setCentralWidget(m_tabs);
    setWindowTitle(tr("Bluetooth"));

    QTimer::singleShot(0, this, SLOT(init()));
}
void K3PasswordDialog::addLine(const QString &key, const QString &value)
{
    if (m_Row > 3)
	return;

    QLabel *lbl = new QLabel(key, m_pMain);
    lbl->setAlignment(Qt::AlignLeft|Qt::AlignTop);
    lbl->setFixedSize(lbl->sizeHint());
    m_pGrid->addWidget(lbl, m_Row+2, 0, Qt::AlignLeft);

    lbl = new QLabel(value, m_pMain);
    lbl->setAlignment(Qt::AlignTop);
    lbl->setWordWrap(true);
    lbl->setFixedSize(275, lbl->heightForWidth(275));
    m_pGrid->addWidget(lbl, m_Row+2, 2, Qt::AlignLeft);
    ++m_Row;
}
QWizardPage * MobileConnectionWizard::createIntroPage()
{
    QWizardPage *page = new QWizardPage();
    page->setTitle(i18nc("Mobile Connection Wizard", "Set up a Mobile Broadband Connection"));
    QVBoxLayout *layout = new QVBoxLayout;

    QLabel *label = new QLabel(i18nc("Mobile Connection Wizard", "This assistant helps you easily set up a mobile broadband connection to a cellular (3G) network."));
    label->setWordWrap(true);
    layout->addWidget(label);

    label = new QLabel("\n" + i18nc("Mobile Connection Wizard", "You will need the following information:"));
    layout->addWidget(label);

    label = new QLabel(QString("  . %1\n  . %2\n  . %3").
                       arg(i18nc("Mobile Connection Wizard", "Your broadband provider's name")).
                       arg(i18nc("Mobile Connection Wizard", "Your broadband billing plan name")).
                       arg(i18nc("Mobile Connection Wizard", "(in some cases) Your broadband billing plan APN (Access Point Name)")));
    layout->addWidget(label);

    if (!mInitialMethodType) {
        label = new QLabel("\n" + i18nc("Mobile Connection Wizard", "Create a connection for &this mobile broadband device:"));
        layout->addWidget(label);

        mDeviceComboBox = new QComboBox();
        mDeviceComboBox->addItem(i18nc("Mobile Connection Wizard", "Any GSM device"));
        mDeviceComboBox->setItemData(0, Knm::Connection::Gsm);
        mDeviceComboBox->addItem(i18nc("Mobile Connection Wizard", "Any CDMA device"));
        mDeviceComboBox->setItemData(1, Knm::Connection::Cdma);
        mDeviceComboBox->insertSeparator(NUMBER_OF_STATIC_ENTRIES-1);
        label->setBuddy(mDeviceComboBox);
        layout->addWidget(mDeviceComboBox);

        QObject::connect(Solid::Control::NetworkManagerNm09::notifier(), SIGNAL(networkInterfaceAdded(QString)),
                         this, SLOT(introDeviceAdded(QString)));
        QObject::connect(Solid::Control::NetworkManagerNm09::notifier(), SIGNAL(networkInterfaceRemoved(QString)),
                         this, SLOT(introDeviceRemoved(QString)));
        QObject::connect(Solid::Control::NetworkManagerNm09::notifier(), SIGNAL(statusChanged(Solid::Networking::Status)),
                         this, SLOT(introStatusChanged(Solid::Networking::Status)));

        introAddInitialDevices();
    }

    page->setLayout(layout);

    return page;
}
Пример #11
0
DlgErrorReport::DlgErrorReport(const QString &xmlWithoutDocument,
                               const QString &xmlWithDocument,
                               QWidget *parent) :
  QDialog (parent),
  m_xmlWithoutDocument (xmlWithoutDocument),
  m_xmlWithDocument (xmlWithDocument)
{
  QVBoxLayout *layout = new QVBoxLayout;
  layout->setSizeConstraint (QLayout::SetFixedSize);
  setLayout (layout);

  QCommonStyle style;
  setModal(true);
  setWindowTitle (tr ("Error Report"));
  setWindowIcon(style.standardIcon (QStyle::SP_MessageBoxCritical));

  QLabel *lblPreview = new QLabel (tr ("An unrecoverable error has occurred. Would you like to send an error report to "
                                       "the Engauge developers?\n\n"
                                       "Adding document information to the error report greatly increases the chances of finding "
                                       "and fixing the problems. However, document information should not be included if your document "
                                       "contains any information that should remain private."));
  lblPreview->setWordWrap(true);
  layout->addWidget (lblPreview);

  m_chkWithDocument = new QCheckBox ("Include document information");
  m_chkWithDocument->setChecked (true);
  updateFile ();
  layout->addWidget (m_chkWithDocument);
  connect (m_chkWithDocument, SIGNAL (stateChanged (int)), this, SLOT (slotDocumentCheckboxChanged (int)));

  QHBoxLayout *layoutButtons = new QHBoxLayout;

  QWidget *panelButtons = new QWidget;
  panelButtons->setLayout (layoutButtons);
  layout->addWidget (panelButtons);

  m_btnSend = new QPushButton(tr ("Send"));
  m_btnSend->setMaximumWidth (MAX_BTN_WIDTH);
  layoutButtons->addWidget (m_btnSend);
  connect (m_btnSend, SIGNAL (released ()), this, SLOT (slotSend()));

  m_btnCancel = new QPushButton(tr ("Cancel"));
  m_btnCancel->setMaximumWidth (MAX_BTN_WIDTH);
  layoutButtons->addWidget (m_btnCancel);
  connect (m_btnCancel, SIGNAL (released ()), this, SLOT (reject ()));
}
Пример #12
0
void KDocumentTextBuffer::checkLineEndings()
{
    QString bufferContents = kDocument()->text();
    if ( bufferContents.contains("\r\n") || bufferContents.contains("\r") ) {
        KDialog* dlg = new KDialog(kDocument()->activeView());
        dlg->setAttribute(Qt::WA_DeleteOnClose);
        dlg->setButtons(KDialog::Ok | KDialog::Cancel);
        dlg->button(KDialog::Ok)->setText(i18n("Continue"));
        QLabel* l = new QLabel(i18n("The document you opened contains non-standard line endings. "
                                    "Do you want to convert them to the standard \"\\n\" format?<br><br>"
                                    "<i>Note: This change will be synchronized to the server.</i>"), dlg);
        l->setWordWrap(true);
        dlg->setMainWidget(l);
        connect(dlg, SIGNAL(okClicked()), this, SLOT(replaceLineEndings()));
        dlg->show();
    }
}
Пример #13
0
/** Add the optional message in a light yellow box to the layout
 *
 * @param mainLay :: layout
 */
void AlgorithmDialog::addOptionalMessage(QVBoxLayout *mainLay) {
  QLabel *inputMessage = new QLabel(this);
  inputMessage->setFrameStyle(QFrame::Panel | QFrame::Sunken);
  QPalette pal = inputMessage->palette();
  pal.setColor(inputMessage->backgroundRole(),
               QColor(255, 255, 224)); // Light yellow
  pal.setColor(inputMessage->foregroundRole(), Qt::black);
  inputMessage->setPalette(pal);
  inputMessage->setAutoFillBackground(true);
  inputMessage->setWordWrap(true);
  inputMessage->setAlignment(Qt::AlignJustify);
  inputMessage->setMargin(3);
  inputMessage->setText(getOptionalMessage());
  QHBoxLayout *msgArea = new QHBoxLayout;
  msgArea->addWidget(inputMessage);
  mainLay->addLayout(msgArea, 0);
}
Пример #14
0
Файл: main.cpp Проект: BGmot/Qt
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QString text("Qt Concurrent is not yet supported on this platform");

    QLabel *label = new QLabel(text);
    label->setWordWrap(true);

#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
    label->showMaximized();
#else
    label->show();
#endif
    qDebug() << text;

    app.exec();
}
Пример #15
0
void AboutDialog::addParagraph(const QString &title, const QString &value)
{
  QGroupBox *gb = new QGroupBox;
  QGridLayout *grid = new QGridLayout;

  grid->setColumnStretch(0, 1);

  QLabel *lab;
  grid->addWidget(lab = new QLabel(value), 0, 0, Qt::AlignLeft|Qt::AlignTop);

  lab->setWordWrap(true);

  gb->setTitle(title);
  gb->setLayout(grid);

  appendWidget(gb);
}
Пример #16
0
PasswordDialog *PasswordDialog::getPassword(QWidget *parent, const QString &windowTitle, const QString &description,
                                            const QString &errorMessage)
{
    auto d = new PasswordDialog(parent);
    d->setWindowTitle(windowTitle);
    d->ui.descriptionLabel->setText(description);
    d->ui.passwordLineEdit->setEchoMode(QLineEdit::Password);

    // fight the word wrapping beast, also see below
    int l,r,t,b; // we're gonna need the horizontal margins
    d->ui.verticalLayout->getContentsMargins(&l,&t,&r,&b);
    QList<QLabel*> fixedLabels; // and the labels we adjusted

    // 1. fix the dialog width, assuming to be wanted.
    d->setMinimumWidth(d->width());
    // 2. fix the label width
    fixedLabels << d->ui.descriptionLabel;
    // NOTICE: d->ui.descriptionLabel is inside a grid layout, which however has 0 margins
    d->ui.descriptionLabel->setMinimumWidth(d->width() - (l+r));
    // 3. have QLabel figure the size for that width and the content
    d->ui.descriptionLabel->adjustSize();
    // 4. make the label a fixed size element
    d->ui.descriptionLabel->setFixedSize(d->ui.descriptionLabel->size());
    d->adjustSize();

    if (!errorMessage.isEmpty()) {
        QLabel *errorLabel = new QLabel(d);
        d->ui.verticalLayout->insertWidget(0, errorLabel);
        errorLabel->setWordWrap(true);
        errorLabel->setText(errorMessage + QLatin1String("\n<hr>"));
        errorLabel->setTextFormat(Qt::RichText);

        // wordwrapping labels are a problem of its own
        fixedLabels << errorLabel;
        errorLabel->setMinimumWidth(d->width() - (l+r));
        errorLabel->adjustSize();
        errorLabel->setFixedSize(errorLabel->size());
    }

    d->adjustSize();
    d->setMinimumWidth(0);
    foreach(QLabel *label, fixedLabels) {
        label->setMinimumSize(0, 0);
        label->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
    }
Пример #17
0
DeleteDialog::DeleteDialog(const QString & title, const QString & text, bool deleteFileCheckBox, QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags)
{
	// we use this dialog instead of the normal QMessageBox because it's currently hard if not impossible to add a checkbox to QMessageBox.
	// supposedly this will be fixed in a future release of Qt.

    this->setWindowTitle(title);
	this->setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint |  Qt::WindowCloseButtonHint);

	QVBoxLayout * vlayout = new QVBoxLayout(this);

	QFrame * frame  = new QFrame(this);
	QHBoxLayout * hlayout = new QHBoxLayout(frame);

    QLabel * iconLabel = new QLabel;
	iconLabel->setPixmap(QMessageBox::standardIcon(QMessageBox::Warning));
    iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    QLabel * label = new QLabel;
	label->setWordWrap(true);
	label->setText(text);

	hlayout->addWidget(iconLabel);
	hlayout->addWidget(label);

	vlayout->addWidget(frame);

	m_checkBox = NULL;
	if (deleteFileCheckBox) {
		m_checkBox = new QCheckBox(tr("Also delete the file"));
		vlayout->addSpacing(7);
		vlayout->addWidget(m_checkBox);
		vlayout->addSpacing(15);
	}

    m_buttonBox = new QDialogButtonBox;
	m_buttonBox->addButton(QDialogButtonBox::Yes);
	m_buttonBox->addButton(QDialogButtonBox::No);
	m_buttonBox->button(QDialogButtonBox::Yes)->setText(tr("Remove"));
	m_buttonBox->button(QDialogButtonBox::No)->setText(tr("Don't remove"));

    QObject::connect(m_buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*)));
	vlayout->addWidget(m_buttonBox);

    this->setModal(true);
}
Пример #18
0
//! [5] //! [6]
QWizardPage *createConclusionPage()
//! [5] //! [7]
{
//! [7]
    QWizardPage *page = new QWizardPage;
    page->setTitle("Conclusion");

    QLabel *label = new QLabel("You are now successfully registered. Have a "
                               "nice day!");
    label->setWordWrap(true);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(label);
    page->setLayout(layout);

    return page;
//! [8]
}
void UpdateCheckerDialog::transferFinished(const bool success)
{
	if (success)
	{
		readyToInstall();
	}
	else
	{
		m_ui->label->setText(tr("Download failed!"));

		QLabel *informationLabel = new QLabel(tr("Check Error Console for more information."), this);
		informationLabel->setWordWrap(true);

		m_ui->gridLayout->addWidget(informationLabel);
	}

	m_ui->buttonBox->setEnabled(true);
}
void RKStandardComponentWizard::addLastPage () {
	RK_TRACE (PLUGIN);

	if (!enslaved) {
		// build the last page
		RKComponent *last_page = stack->addPage (component);
		QVBoxLayout *vbox = new QVBoxLayout (last_page);
		vbox->setContentsMargins (0, 0, 0, 0);
		QLabel *label = new QLabel (i18n ("Below you can see the command(s) corresponding to the settings you made. Click 'Submit' to run the command(s)."), last_page);
		label->setWordWrap (true);
		code_display = new RKCommandEditorWindow (last_page, true);
		vbox->addWidget (label);
		vbox->addWidget (code_display);
	}

	stack->goToFirstPage ();
	updateState ();
}
Пример #21
0
SecurityPage::SecurityPage(QWidget* parent)
        : QWizardPage(parent)
{
    setTitle(tr("Designed to be secure"));
    setSubTitle(tr("Using modern technologies such as PolicyKit, Shaman delivers a secure user experience"));

    QLabel *lbl = new QLabel(tr("When designing the new Shaman, security was one of the primary concerns, and one "
                                "of the things which needed vast improvements against the previous versions.\n\nAqpm, "
                                "the library underneath Shaman, is designed to be run as a standard user, and uses "
                                "privilege elevation through PolicyKit, granting you both authorization fine tuning "
                                "for package management, and total security over the whole process.\n\nWith Shaman/Aqpm, "
                                "even package download happens as unprivileged user."));
    lbl->setWordWrap(true);

    QVBoxLayout *lay = new QVBoxLayout();
    lay->addWidget(lbl);
    setLayout(lay);
}
Пример #22
0
/**
 * Third panel - Stream info
 * Display all codecs and muxers info that we could gather.
 **/
InfoPanel::InfoPanel( QWidget *parent ) : QWidget( parent )
{
     QGridLayout *layout = new QGridLayout(this);

     QList<QTreeWidgetItem *> items;

     QLabel *topLabel = new QLabel( qtr( "Information about what your media or"
              " stream is made of.\nMuxer, Audio and Video Codecs, Subtitles "
              "are shown." ) );
     topLabel->setWordWrap( true );
     layout->addWidget( topLabel, 0, 0 );

     InfoTree = new QTreeWidget(this);
     InfoTree->setColumnCount( 1 );
     InfoTree->header()->hide();
     InfoTree->header()->setResizeMode(QHeaderView::ResizeToContents);
     layout->addWidget(InfoTree, 1, 0 );
}
Пример #23
0
void LoadPage::setupUi()
{
    QVBoxLayout * l = new QVBoxLayout; {
        QLabel * infoLabel = new QLabel; {
            infoLabel->setText("Выберите файл с данными\n"
                               "Предполагается, что числа в файле разделены символом \";\", "
                               "а в качестве дробного знака используется точка");
            infoLabel->setWordWrap(true);
            infoLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
        }

        QPushButton * openFile = new QPushButton("Открыть файл"); {
            connect(openFile, SIGNAL(clicked()), this, SLOT(openFileDialog()) );
        }

        QHBoxLayout * buttonLayout = new QHBoxLayout; {

            QPushButton * nextButton = new QPushButton("Далее"); {
                nextButton->setEnabled(false);
                connect(nextButton, SIGNAL(clicked()), this, SIGNAL(nextPage()) );
                connect(this, SIGNAL(dataRead(bool)), nextButton, SLOT(setEnabled(bool)) );
            }

            QPushButton * backButton = new QPushButton("Назад"); {
                // fake button
                backButton->setEnabled(false);
            }

            buttonLayout->addWidget(backButton);
            buttonLayout->addWidget(nextButton);
        }

        table = new QTableWidget; {
            table->setEditTriggers(QTableWidget::NoEditTriggers);
        }

        l->addWidget(infoLabel);
        l->addWidget(openFile);
        l->addWidget(table);
        l->addLayout(buttonLayout);
    }

    this->setLayout(l);
}
Пример #24
0
CallConfirmWidget::CallConfirmWidget(const QWidget* Anchor, const Friend& f) :
    QWidget(), anchor(Anchor), f(f),
    rectW{120}, rectH{85},
    spikeW{30}, spikeH{15},
    roundedFactor{20},
    rectRatio(static_cast<qreal>(rectH)/static_cast<qreal>(rectW))
{
    setWindowFlags(Qt::SubWindow);
    setAttribute(Qt::WA_DeleteOnClose);

    QPalette palette;
    palette.setColor(QPalette::WindowText, Qt::white);
    setPalette(palette);

    QVBoxLayout *layout = new QVBoxLayout(this);
    QLabel *callLabel = new QLabel(QObject::tr("Incoming call..."), this);
    callLabel->setStyleSheet("color: white");
    callLabel->setWordWrap(true);
    callLabel->setAlignment(Qt::AlignHCenter);
    QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Horizontal, this);
    QPushButton *accept = new QPushButton(this), *reject = new QPushButton(this);
    accept->setFlat(true);
    reject->setFlat(true);
    accept->setStyleSheet("QPushButton{border:none;}");
    reject->setStyleSheet("QPushButton{border:none;}");
    accept->setIcon(QIcon(":/ui/acceptCall/acceptCall.svg"));
    reject->setIcon(QIcon(":/ui/rejectCall/rejectCall.svg"));
    accept->setIconSize(accept->size());
    reject->setIconSize(reject->size());

    buttonBox->addButton(accept, QDialogButtonBox::AcceptRole);
    buttonBox->addButton(reject, QDialogButtonBox::RejectRole);

    connect(buttonBox, &QDialogButtonBox::accepted, this, &CallConfirmWidget::accepted);
    connect(buttonBox, &QDialogButtonBox::rejected, this, &CallConfirmWidget::rejected);

    layout->setMargin(12);
    layout->addSpacing(spikeH);
    layout->addWidget(callLabel);
    layout->addWidget(buttonBox);

    setFixedSize(rectW,rectH+spikeH);
    reposition();
}
Пример #25
0
void PythonInfoWidget::onModuleRegistered(PyModule* module) {
    QScrollArea* tab = new QScrollArea(tabWidget_);
    tab->setWidgetResizable(true);
    QWidget* content = new QWidget(tab);
    std::vector<PyMethod*> methods =  module->getPyMethods();
    QGridLayout* layout = new QGridLayout();
    layout->setColumnStretch(2,1);
    QLabel* funcLabel = new QLabel("Function");
    QLabel* paramLabel = new QLabel("Parameters");
    QLabel* descLabel = new QLabel("Description");
    QFont font = funcLabel->font();
    font.setPointSize(font.pointSize()+1);
    font.setBold(true);
    funcLabel->setFont(font);
    paramLabel->setFont(font);
    descLabel->setFont(font);

    layout->addWidget(funcLabel,0,0);
    layout->addWidget(paramLabel,0,1);
    layout->addWidget(descLabel,0,2);
    layout->addWidget(new QLabel("<hr />"),1,0,1,3);

    int row = 0;
    for (int i = 0; i<static_cast<int>(methods.size()); ++i) {
        row = i*2 + 2;
        QLabel* functionNameLabel = new QLabel(methods[i]->getName().c_str());
        functionNameLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        layout->addWidget(functionNameLabel,row,0);
        std::string params = methods[i]->getParamDesc();
        replaceInString(params," , ","<br />");
        layout->addWidget(new QLabel(params.c_str()),row,1);
        QLabel* desc = new QLabel(methods[i]->getDesc().c_str());
        desc->setWordWrap(true);
        layout->addWidget(desc,row,2);
        layout->addWidget(new QLabel("<hr />"),row+1,0,1,3);
    }

    if(row)
        layout->addItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Expanding),row+2,0);

    content->setLayout(layout);
    tab->setWidget(content);
    tabWidget_->addTab(tab,module->getModuleName());
}
Пример #26
0
void MainWindow::on_action_Resolve_Symbols_triggered()
{
  m_Ctx->Renderer()->AsyncInvoke([this](IReplayRenderer *r) { r->InitResolver(); });

  QProgressDialog *m_Progress =
      new QProgressDialog(tr("Please Wait - Resolving Symbols"), QString(), 0, 0, this);
  m_Progress->setWindowTitle("Please Wait");
  m_Progress->setWindowFlags(Qt::CustomizeWindowHint | Qt::Dialog | Qt::WindowTitleHint);
  m_Progress->setWindowIcon(QIcon());
  m_Progress->setMinimumSize(QSize(250, 0));
  m_Progress->setMaximumSize(QSize(250, 10000));
  m_Progress->setCancelButton(NULL);
  m_Progress->setMinimumDuration(0);
  m_Progress->setWindowModality(Qt::ApplicationModal);
  m_Progress->setValue(0);

  QLabel *label = new QLabel(m_Progress);

  label->setText(tr("Please Wait - Resolving Symbols"));
  label->setAlignment(Qt::AlignCenter);
  label->setWordWrap(true);

  m_Progress->setLabel(label);

  LambdaThread *thread = new LambdaThread([this, m_Progress]() {
    bool running = true;

    while(running)
    {
      // just bail if we managed to get here without a resolver.
      m_Ctx->Renderer()->BlockInvoke(
          [&running](IReplayRenderer *r) { running = r->HasCallstacks() && !r->InitResolver(); });
    }

    GUIInvoke::call([this, m_Progress]() {
      m_Progress->hide();
      delete m_Progress;
      if(m_Ctx->hasAPIInspector())
        m_Ctx->apiInspector()->on_apiEvents_itemSelectionChanged();
    });
  });
  thread->selfDelete(true);
  thread->start();
}
AdditionalInfoDialog::AdditionalInfoDialog(QWidget* parent,
                                           const QList<QByteArray>& visibleRoles) :
    KDialog(parent),
    m_visibleRoles(visibleRoles),
    m_listWidget(0)
{
    setCaption(i18nc("@title:window", "Additional Information"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);

    QWidget* mainWidget = new QWidget(this);
    mainWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);

    // Add header
    QLabel* header = new QLabel(mainWidget);
    header->setText(i18nc("@label", "Select which additional information should be shown:"));
    header->setWordWrap(true);

    // Add checkboxes
    bool nepomukRunning = false;
    bool indexingEnabled = false;
#ifdef HAVE_NEPOMUK
    nepomukRunning = (Nepomuk::ResourceManager::instance()->initialized());
    if (nepomukRunning) {
        KConfig config("nepomukserverrc");
        indexingEnabled = config.group("Service-nepomukfileindexer").readEntry("autostart", false);
    }
#endif

    m_listWidget = new QListWidget(mainWidget);
    m_listWidget->setSelectionMode(QAbstractItemView::NoSelection);
    const QList<KFileItemModel::RoleInfo> rolesInfo = KFileItemModel::rolesInformation();
    foreach (const KFileItemModel::RoleInfo& info, rolesInfo) {
        QListWidgetItem* item = new QListWidgetItem(info.translation, m_listWidget);
        item->setCheckState(visibleRoles.contains(info.role) ? Qt::Checked : Qt::Unchecked);

        const bool enable = (!info.requiresNepomuk && !info.requiresIndexer) ||
                            (info.requiresNepomuk && nepomukRunning) ||
                            (info.requiresIndexer && indexingEnabled);

        if (!enable) {
            item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
        }
    }
Пример #28
0
void JabberEditAccountWidget::createGeneralTab(QTabWidget *tabWidget)
{
	QWidget *generalTab = new QWidget(this);

	QGridLayout *layout = new QGridLayout(generalTab);
	QWidget *form = new QWidget(generalTab);
	layout->addWidget(form, 0, 0);

	QFormLayout *formLayout = new QFormLayout(form);

	AccountId = new QLineEdit(this);
	connect(AccountId, SIGNAL(textEdited(QString)), this, SLOT(dataChanged()));
	formLayout->addRow(tr("Username") + ':', AccountId);

	AccountPassword = new QLineEdit(this);
	AccountPassword->setEchoMode(QLineEdit::Password);
	connect(AccountPassword, SIGNAL(textEdited(QString)), this, SLOT(dataChanged()));
	formLayout->addRow(tr("Password") + ':', AccountPassword);

	RememberPassword = new QCheckBox(tr("Remember password"), this);
	RememberPassword->setChecked(true);
	connect(RememberPassword, SIGNAL(clicked()), this, SLOT(dataChanged()));
	formLayout->addRow(0, RememberPassword);

	QLabel *changePasswordLabel = new QLabel(QString("<a href='change'>%1</a>").arg(tr("Change your password")));
	changePasswordLabel->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard | Qt::LinksAccessibleByMouse);
	formLayout->addRow(0, changePasswordLabel);
	connect(changePasswordLabel, SIGNAL(linkActivated(QString)), this, SLOT(changePasssword()));

	Identities = new IdentitiesComboBox(false, this);
	connect(Identities, SIGNAL(identityChanged(Identity)), this, SLOT(dataChanged()));
	formLayout->addRow(tr("Account Identity") + ':', Identities);

	QLabel *infoLabel = new QLabel(tr("<font size='-1'><i>Select or enter the identity that will be associated with this account.</i></font>"), this);
	infoLabel->setWordWrap(true);
	infoLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
	infoLabel->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
	formLayout->addRow(0, infoLabel);

	AccountAvatarWidget *avatarWidget = new AccountAvatarWidget(account(), this);
	layout->addWidget(avatarWidget, 0, 1, Qt::AlignTop);

	tabWidget->addTab(generalTab, tr("General"));
}
Пример #29
0
AboutWindow::AboutWindow(QWidget* parent)
    : QDialog(parent)
{
    setWindowTitle(tr("About Rabenstein"));
    QPushButton* button = new QPushButton(tr("OK"), this);
    QVBoxLayout* vlayout = new QVBoxLayout(this);
    QLabel* text = new QLabel(this);
    button->setDefault(true);
    text->setWordWrap(true);
    text->setOpenExternalLinks(true);
    text->setText(tr("Rabenstein") +
                  tr("<br/><br/> Version: %1")
                  .arg(Rabenstein::version.c_str()) +
                  tr("<br/><br/>Rabenstein is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<br/>"));
    connect(button, SIGNAL(clicked()),
            this, SLOT(reject()));
    vlayout->addWidget(text);
    vlayout->addWidget(button);
}
FileVersionConverterDialog::FileVersionConverterDialog(
        QWidget * parent,
        const QString & fileName,
        const QString & backupName) :

    QDialog(parent)
{
    setWindowTitle(tr("File conversion required"));
    setMinimumSize(500, 200);

    // Body text
    QLabel * textLabel = new QLabel(tr(
        "The file %1 was created with an older version of VPaint and "
        "must be converted before it can be opened with your current "
        "version. Are you ok to proceed?").arg(fileName));
    textLabel->setWordWrap(true);
    textLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);

    // Keep old version checkbox
    QCheckBox * keepOldVersionCheckBox = new QCheckBox(
        tr("Keep a copy of the original file at %1").arg(backupName));
    keepOldVersionCheckBox->setChecked(global()->settings().keepOldVersion());
    connect(keepOldVersionCheckBox, SIGNAL(toggled(bool)), this, SLOT(keepOldVersionToggled(bool)));

    // Don't notify me next time
    QCheckBox * dontNotifyConversionCheckBox = new QCheckBox(
        tr("Don't notify me next time, just do it").arg(backupName));
    dontNotifyConversionCheckBox->setChecked(global()->settings().dontNotifyConversion());
    connect(dontNotifyConversionCheckBox, SIGNAL(toggled(bool)), this, SLOT(dontNotifyConversionToggled(bool)));

    // Dialog buttons
    QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    // Main layout
    QVBoxLayout * layout = new QVBoxLayout();
    layout->addWidget(textLabel);
    layout->addWidget(keepOldVersionCheckBox);
    layout->addWidget(dontNotifyConversionCheckBox);
    layout->addWidget(buttonBox);
    setLayout(layout);
}